package com.atguigu.eduservice.controller.front;

import com.atguigu.commonutils.result.R;
import com.atguigu.eduservice.service.EduTeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author kabuda
 * @create 2023-05-16 14:19
 */
@RestController
@RequestMapping("/eduservice/front/teacher")
public class FrontTeacherController {
    @Autowired
    private EduTeacherService teacherService;

    @GetMapping("{page}/{limit}")
    public R pageTeacher(@PathVariable("page")Long page,@PathVariable("limit")Long limit){
        Map<String,Object> map=teacherService.pageTeacher(page,limit);
        return R.ok().data(map);
    }

    @GetMapping("/teacherInfo/{teacherId}")
    public R getTeacherInfo(@PathVariable("teacherId")String teacherId){
       R r= teacherService.getTeacherInfo(teacherId);
       return r;
    }


}
